<?php
/**
 * 新闻评论管理
 * 
 * @author  Lee<a60533372@gmail.com>
 * @time    2016-08-06
 */
namespace Model;
use Think\Model;

class NewsCommentModel extends Model{
    /*
     * 审核，批量审核,待审核，批量待删除，新闻评论
     * 
     * @return bool
     */
    public function edit($where){
        $g  =$where['commentId'];
        if(is_array($where['commentId'])){
            $g  =implode(',',$where['commentId']);
            $where['commentId']=array("in",implode(',',$where['commentId']));            
        }
        if($this->save($where)){
            $data=array(
                "user_id"   =>session("authId"),
                'content'   =>"编辑了id为 ".$g." 的新闻评论",
                "add_time"  =>time()
            );
            if(M("Log")->add($data)){
                return TRUE;
            }else{
                return FALSE;
            }
        }
    }
}
